package com.lb.io.heima.bio.three;

import java.net.ServerSocket;
import java.net.Socket;

/**
 * @ClassName 实现服务端可以同时接受多个客户端的socket请求
 * @Author LB
 * @Date 2021/12/17 10:24
 **/
public class BioServer {
    public static void main(String[] args){
        try {
            System.out.println("==服务器的启动==");
            ServerSocket serverSocket = new ServerSocket(8888);
            while (true){
                Socket accept = serverSocket.accept();
                new ServerThreadReader(accept).start();
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}